<!-- 主页 -->
<template>
	<view class="container">
		<!-- 商品信息 -->
		<view class="goods-info">
			<image class="pic" src="/pagesC-order/static/images/will-delete/goods1.png" mode="aspectFill"></image>
			<text class="desc">舒绝杀蚁饵剂</text>
			<text class="count">x1</text>
		</view>

		<view class="btn-group">
			<view class="btn" @click="handleRefund('0')">
				<text class="icon iconfont">&#xe630;</text>
				<view class="text">
					<text class="title">我要退货退款</text>
					<text class="label">已收到货，需要退还已收到的货物</text>
				</view>
				<text class="arrow-icon iconfont">&#xe61a;</text>
			</view>

			<view class="btn" @click="handleRefund('1')">
				<text class="icon iconfont">&#xe7cf;</text>
				<view class="text">
					<text class="title">我要退款（无需退货）</text>
					<text class="label">未收到货，或与商家协商之后申请</text>
				</view>
				<text class="arrow-icon iconfont">&#xe61a;</text>
			</view>
		</view>
	</view>
</template>

<script setup>
	const emits = defineEmits(['on-change-type']);

	const handleRefund = (type) => {
		emits('on-change-type', type);
	}
</script>

<style lang="scss" scoped>
	$redColor: #f03d3d;

	.goods-info {
		position: relative;
		display: flex;
		align-items: flex-start;
		padding: 20rpx 30rpx;
		background-color: white;
		border-top: 2rpx solid #fafafa;

		.pic {
			width: 80rpx;
			height: 80rpx;
			border-radius: 10rpx;
		}

		.desc {
			font-size: 28rpx;
			color: #888;
			margin-left: 20rpx;
		}

		.count {
			position: absolute;
			bottom: 20rpx;
			right: 20rpx;
			font-size: 28rpx;
			color: #888;
		}
	}

	.btn-group {
		padding: 0 30rpx;

		.btn {
			position: relative;
			display: flex;
			align-items: flex-start;
			padding: 50rpx 30rpx 50rpx 40rpx;
			border-radius: 20rpx;
			background-color: white;
			margin-top: 30rpx;

			&:active {
				background-color: #fafafa;
			}

			.icon {
				font-size: 40rpx;
				color: $redColor;
			}

			.text {
				padding-left: 30rpx;

				.title {
					font-size: 40rpx;
				}

				.label {
					display: block;
					font-size: 28rpx;
					color: #888;
					margin-top: 20rpx;
				}
			}

			.arrow-icon {
				position: absolute;
				top: 50%;
				right: 30rpx;
				transform: translateY(-50%);
				font-size: 30rpx;
				color: #aaa;
			}
		}

	}
</style>